<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns="http://www.w3.org/1999/xhtml">
<?php
	
	require('includes/modules/payment/glbpay/glbpay_application_top.php'); 
	if(empty($_SESSION['language'])){
		 zen_redirect(zen_href_link('/', '', 'SSL', true, false));
	}
	require('includes/languages/' . $_SESSION['language'] . '/modules/payment/glbpay.php');
	$exchangerate=$_POST["exchangerate"];
	$sourceamount=$_POST["sourceamount"];
	$sourcecurrency=$_POST["sourcecurrency"];
	$targetamount=$_POST["targetamount"];
	$targetcurrency=$_POST["targetcurrency"];
	$txnid=$_POST["txnid"];
	
	$lines_string='';
	$url='';
	$host=$_SERVER['HTTP_HOST'];
	$localpath=substr($_SERVER['PHP_SELF'],1);		
	if(strpos($localpath,'/')>0){
		$file=substr($localpath,0,strpos($localpath,'/'));
		$fullfile=$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
		$url= 'http://'.substr($fullfile,0,strpos($fullfile,$file)+strlen($file)).'/';
	}else{	   
		$url='http://'.$_SERVER['HTTP_HOST'].'/';
	} 		
	$lines_string=file_get_contents($url); 
	
	$headStart= stripos($lines_string,"<head"); 
	$headEnd=stripos($lines_string,"</head"); 
	$bodyStart= stripos($lines_string,"<body"); 
	$bodyEnd= stripos($lines_string,"</body"); 	
	$body=substr($lines_string,$bodyStart,$bodyEnd-$bodyStart);  
	$bodyLineEnd =stripos($body,">"); 
	echo substr($lines_string,$headStart,$headEnd-$headStart);	
?>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>   
    <style type="text/css"> 
	   body, h1, h2, h3, h4, h5, h6, p, blockquote, pre, code, del, dfn, em, img, strong, dd, dl, dt, li, ol, ul, fieldset, form, label, button, input, table, caption, tbody, tfoot, thead, tr, th, td, menu {
	   margin:0;padding:0;}
       article, aside, details, figcaption, figure, footer, header, hgroup, nav, section {	display:block}
       audio, canvas, video {	display:inline-block;*display:inline;*zoom:1}
       audio:not([controls]) {display:none} 
       table {	border-collapse:collapse;	border-spacing:0;	empty-cells:show}
       ol, ul, menu {	list-style:none}
       img {	border:0}
       a:focus {	outline:none}
       a {	color:#0088DB;	text-decoration:none;	cursor:pointer}
       a:hover {	color:#2A5E8E}
       .clearfix:after, .central:after, .widget ul:after, .paging:after, .pagenav:after, .base-tit:after {	content:".";	display:block;	height:0;	clear:both;	visibility:hidden}
       .clearfix, .central, .widget ul, .paging, .pagenav, .base-tit {*+height:1%;}
       body, button, input, select, textarea, code {	font-size:12px;	font-family:arial;	color: #444;}
       .ipt {	border: solid 1px #d2d2d2;	border-left-color: #ccc;	border-top-color: #ccc;	border-radius: 2px;	box-shadow: inset 0 1px 0 #f8f8f8;
       	background-color: #fff;	padding: 4px 6px;	height: 21px;	line-height: 21px;	color: #555;	width: 180px;	vertical-align: baseline;}
       .ipt-mini {	width: 140px;	padding: 1px 3px;}
       .ipt:focus {	border-color: #95C8F1;	box-shadow: 0 0 4px #95C8F1;}
       .theme-buy {	margin-top:10%;	text-align: center;}
       .theme-gobuy, .theme-signin {	font-size: 15px;}
       .theme-price {	position: relative;	bottom: -6px;	font-family: microsoft yahei, Arial, Helvetica, sans-serif;	margin-right: 20px;
       	font-weight: bold;	color: #f60;	line-height: 32px;	font-size: 24px;	display: inline-block;}
       .theme-price dfn {	font-style: normal;	font-size: 18px;	margin-right: 2px;}
       .theme-desc {	padding: 30px;}
       .theme-version {	padding: 30px;}
       .theme-popover-mask {	z-index: 9998;	position:fixed;	top:0;	left:0;	width:100%;	height:100%;
       	background:#4D4D4D;	opacity:0.7;	filter:alpha(opacity=70);	display:none}
       .theme-popover {	z-index:9999;	position:fixed;	top:50%;	left:50%;	width:700px;	height:420px;	margin:-180px 0 0 -330px;
       	border-radius:5px;	border:solid 2px #666;	background-color:#fff;	display:none;	box-shadow: 0 0 10px #666;}
       .theme-poptit {	border-bottom:1px solid #ddd;	padding:12px;	position: relative;}
       .theme-popbod {	padding:60px 15px;	color:#444;	height: 148px;}
       .theme-popbom {	padding:15px;	background-color:#f6f6f6;	border-top:1px solid #ddd;	border-radius:0 0 5px 5px;	color:#666}
       .theme-popbom a {	margin-left:8px}
       .theme-poptit .close {	float:right;	color:#999;	padding:5px;	margin:-2px -5px -5px;	font:bold 14px/14px simsun;	text-shadow:0 1px 0 #ddd}
       .theme-poptit .close:hover {	color:#444;}
       .btn.theme-reg {	position: absolute;	top: 8px;	left: 43%;	display: none}
       .inp-gray, .feed-mail-inp {	border:1px solid #ccc;	background-color:#fdfdfd;	width:220px;	height:16px;
       	padding:4px;	color:#444;	margin-right:6px}
       .dform {	padding:80px 60px 40px;	text-align: center;}
       .dform .ipt_error {	background-color:#FFFFCC;	border-color:#FFCC66}
       .dform-tip {	display:none;	background-color:#080;	color:#fff;	line-height:42px;	margin-top:10px;display:;	font-size: 14px;}
       .dform-tip-errer {	background-color: #CF301A;}
       .dform-tip a {	display: inline-block;	padding: 0 20px;	margin-left:10px;	background-color: #FFE924;	color: #CF301A;}
       .dform-login {	padding:0;	height: 270px;	overflow: hidden;}
       .dform-login iframe {	height: 470px;	margin-top: -180px;}
       .theme-signin {	margin: -70px 0px 0px 0px;	border:1px solid #D2D7DC;	text-align:center;	font-size: 14px;}
       .theme-signin  h1 {	color:#000;	font-weight:300;	margin-bottom: 10px;	font-size: 24px;}
       .theme-signin  h2 {	color:#f88912;	font-weight:100;	margin-bottom: 5px;	font-size: 22px;}
       .theme-signin p {	font-size: 15px;	color: ＃5c5b5b;	text-align:left;}
       .theme-curr {	margin:40px 0px 0px 0px;		text-align:left;	font-size: 14px;}
       .theme-curr  h1 {	color:#000;	font-weight:100;		margin-bottom: 10px;	font-size: 16px;}
       .theme-curr  hr {	height:1px;    width:100%;	background:#D2D7DC;	overflow:hidden;}
       .butt {	width: 240px;	height: 50px;	line-height: 38px;	text-align: center;	font-weight: bold;		font-size: 20px;	color: white;
       	text-shadow:1px 1px 1px #333;	background:url('./resource/image/but_bja.png') no-repeat scroll top right;	border-radius: 5px;	margin:0 20px 20px 0;
       	position: relative;	overflow: hidden;}
       .theme-desc, .theme-version {	padding-top: 0 }
	</style>
</head>	 
<?php
	if(empty($txnid)){//如果订单为空,就返回上一页
		echo '<body><script type="text/script">history.go(-1);</script>';
	}else{
		echo substr($lines_string,$bodyStart,$bodyLineEnd+1);
	
?>
<div class="theme-popover">
   <form action="api_dodcc.php" method="post" id="fromDcc" name="fromDcc">
	 <input type="hidden" name="hdsourceamount" id="hdsourceamount" value="<?php echo $sourceamount; ?>"/>
	 <input type="hidden" name="hdsourcecurrency" id="hdsourcecurrency" value="<?php echo $sourcecurrency; ?>"/> 
	 <input type="hidden" name="hdtargetamount" id="hdtargetamount" value="<?php echo $targetamount; ?>"/>
	 <input type="hidden" name="hdtargetcurrency" id="hdtargetcurrency" value="<?php echo $targetcurrency; ?>"/> 
	 <input type="hidden" name="hdtxnid" id="hdtxnid" value="<?php echo $txnid; ?>"/> 
     <div class="theme-poptit"> 
          <h3><?php echo MODULE_PAYMENT_GLBPAY_API_DCC_CONFIRM ;?></h3>
     </div>
     <div class="theme-popbod dform">
          <div class="theme-signin">
		   <h1> <?php echo MODULE_PAYMENT_GLBPAY_API_DCC_EXCHANGERATE ;?></h1>		
		   <h2> <?php echo $sourcecurrency.':'.$targetcurrency.' = '.$exchangerate ?></h2>	
		   <br/>
		   <p><?php echo MODULE_PAYMENT_GLBPAY_API_DCC_NOTE1;?>
		   </p><p><?php echo MODULE_PAYMENT_GLBPAY_API_DCC_NOTE2;?></p>
		  </div>
		  <div class="theme-curr">
			<h1><?php echo MODULE_PAYMENT_GLBPAY_API_DCC_PLEASESELECT ;?></h1>
			<hr></hr>
			<center>
			<input type="hidden" name="hdSelectAmount" id="hdSelectAmount" />
			<input type="hidden" name="hdSelectCurrency" id="hdSelectCurrency" />
			<input type="button" class="butt" id="btn_source" value="<?php echo  $sourcecurrency.' '.$sourceamount  ?>" />
			<input type="button" id="btn_target" class="butt" value="<?php echo $targetcurrency.' '.$targetamount ?>" />
			</center>
		  </div>			
     </div>
   </form>
</div>
<div class="theme-popover-mask"></div>
 <script type="text/javascript">	 
 
	$(document).ready(function($) { 
	   $(window).scroll(function(){
	   	  var scroller = $('.rollto');
	   	  document.documentElement.scrollTop+document.body.scrollTop>200?scroller.fadeIn():scroller.fadeOut();
	   }); 

		$('.ico-totop').click(function(){
			$('html,body').animate({scrollTop:0},300);
		});
	
		$('.ico-torespond').click(function(){
			scrollTo('.ico-torespond');
			$('#comment').focus();
		});
	 
		$('.btn-headermenu,.popup-layer,.popup-arrow').click(function(event) {
			event.stopPropagation();
		});
		
		$('.btn-headermenu').each(function(){
			$(this).click(function(){
				$(this).toggleClass('btn-active');
				$(this).next().toggle();
				$(this).next().next().toggle();
				$(this).parent().siblings().find('.popup-layer,.popup-arrow').hide();
			});
		});
	
		function scrollTo(name){
			var ID = $($(name).attr('href'));
			if(ID.length>0)
			$('html,body').animate({scrollTop: ID.offset().top-10},300);
		}
		
		$("#btn_source").click(function (){
			$("#hdSelectAmount").val($("#hdsourceamount").val());
			$("#hdSelectCurrency").val($("#hdsourcecurrency").val());
			$("#fromDcc").submit();
		});
		
		$("#btn_target").click(function (){
			$("#hdSelectAmount").val($("#hdtargetamount").val());
			$("#hdSelectCurrency").val($("#hdtargetcurrency").val());
			$("#fromDcc").submit();
		});
		
		$('.theme-popover-mask').fadeIn(100);
		$('.theme-popover').slideDown(200);  
		
	});
	</script>	
<?php
	echo substr($lines_string,$bodyStart+$bodyLineEnd+1,$bodyEnd-$bodyStart-$bodyLineEnd-1);
	}
?>
</body> 
</html>	